import type { AjaxPagingResult } from '@/types'
import type { QueryParams, ListItem, SaveParams } from '@/views/equipment-maintenance/type'

const controller = getAjaxBaseUrl('/equipmentMaintenance', '/energy')

/** 分页查询设备维护信息列表 */
export function queryEquipmentMaintenanceListByPage(params: QueryParams) {
  return post<AjaxPagingResult<ListItem[]>>(`${controller}/list`, params)
}

/** 保存设备维护信息 */
export function saveEquipmentMaintenance(params: SaveParams) {
  return post(`${controller}/save`, params)
}

/** 删除设备维护信息 */
export function deleteEquipmentMaintenance(id: number) {
  return get(`${controller}/del`, { id })
}
